Interface for swapping inputs and outputs based on cost model + working permute example (#18929)#18929
Interface for swapping inputs and outputs based on cost model + working permute example (#18929)#18929DrJessop wants to merge 2 commits intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18929
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 1 New Failure, 1 Cancelled Job, 2 Unrelated FailuresAs of commit f65b936 with merge base a489707 ( NEW FAILURE - The following job has failed:
CANCELLED JOB - The following job was cancelled. Please retry:
BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@DrJessop has exported this pull request. If you are a Meta employee, you can view the originating Diff in D100917820. |
This PR needs a
|
Summary: - Adds support to run to run passes on ExportedPrograms and EdgeProgramManager - EdgeProgramManager transform behaves basically like a pass manager Reviewed By: larryliu0820, ethansfng Differential Revision: D91725222
…ng permute example (pytorch#18929) Summary: I have seen the following pattern quite a bit so far where we have wrapper(x0), wrapper(x1), x2 -> op -> wrapper(o0), o1 for example, and it is semantically equivalent to instead run x0, x1, wrapper(x2) -> op -> o0, wrapper(o1) In case 1, we had 3 wrapper ops, and in case 2, we have 2, so it's better to run 2. This interface formalizes this idea. I also implemented the pass which uses this interface for the permute case. What is really nice about this interface is that in a single pass, we can do a LOT of cleanup. See the docs in the diff for a case for adds. Differential Revision: D100917820
c5916b3 to
c231967
Compare
…ng permute example (pytorch#18929) Summary: I have seen the following pattern quite a bit so far where we have wrapper(x0), wrapper(x1), x2 -> op -> wrapper(o0), o1 for example, and it is semantically equivalent to instead run x0, x1, wrapper(x2) -> op -> o0, wrapper(o1) In case 1, we had 3 wrapper ops, and in case 2, we have 2, so it's better to run 2. This interface formalizes this idea. I also implemented the pass which uses this interface for the permute case. What is really nice about this interface is that in a single pass, we can do a LOT of cleanup. See the docs in the diff for a case for adds. Differential Revision: D100917820
c231967 to
f65b936
Compare
Summary:
I have seen the following pattern quite a bit so far where we have
wrapper(x0), wrapper(x1), x2 -> op -> wrapper(o0), o1
for example, and it is semantically equivalent to instead run
x0, x1, wrapper(x2) -> op -> o0, wrapper(o1)
In case 1, we had 3 wrapper ops, and in case 2, we have 2, so it's better to run 2. This interface formalizes this idea. I also implemented the pass which uses this interface for the permute case.
What is really nice about this interface is that in a single pass, we can do a LOT of cleanup. See the docs in the diff for a case for adds.
Differential Revision: D100917820